#ifndef __STATE_MANAGER_H__
#define __STATE_MANAGER_H__

#include <map>
#include "State.h"
#include "Define.h"
#include "..\MessageServer.h"
#include "..\Log.h"

class StateManager
{
private:
	std::map<const char*, State*> m_lstPrepState;
	static StateManager * m_pInstance;

	State * m_pPrevState;
	State * m_pCurrState;
	State * m_pNextState;
protected:
	StateManager();

	void InternalSwitch();
	friend void CallBackInternalSwitch(const FWobject, FWobject);
public:
	~StateManager();
	static StateManager * GetInstance();
	static void DestroyInstance();

	//void Switch(State * pState);
	void Switch(const char * szName);
	void ExternalSwitch();
	void RemoveState(const char* szName);
	void RegisterState(const char* szName, State * pState);

	State * GetCurrentState();
};

#endif